#include <iostream>
#include <cstring>
#include <algorithm>

using namespace std;

const int N = 100010, INF = 2e9;
int n;
int w[N];

int main()
{
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);

    scanf("%d", &n);
    for (int i = 1; i <= n; i ++) scanf("%d", &w[i]);

    sort(w + 1, w + n + 1);
    w[n + 1] = INF;

    int l = 1, r = upper_bound(w + 1, w + n + 1, w[1]) - w;
    while (r <= n)
    {
        l ++;
        r = upper_bound(w + r + 1, w + n + 1, w[l]) - w;
    }
    printf("%d\n", n - l + 1);

    return 0;
}
